package com.zmn.oms.services.interfaces.fcorderpart;

import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.entity.fcorderpart.OrderFactoryPartPost;
import com.zmn.oms.model.entity.fcorderpart.OrderFactoryPartPostQuery;

import java.util.List;

/**
 * 类描述：厂商订单配件物流信息
 * @author lujia
 * @date 2019/5/11 16:29
 */
public interface OrderFactoryPartPostService {

    /**
     * 新增
     * @param orderFactoryPartPost
     * @return
     */
    Integer insert(OrderFactoryPartPost orderFactoryPartPost);

    /**
     * 厂商配件物流信息
     * @param orderIdList
     * @return
     */
    List<OrderFactoryPartPost> listEsOrderFactoryPartPostByOrderIdList(List<Long> orderIdList);

    /**
     * 根据订单id查询厂商配件物流信息
     * @param orderId
     * @return
     */
    List<OrderFactoryPartPost> listOrderFactoryPartPostByOrderId(Long orderId);
    /**
     * 根据订单配件id查询厂商配件物流信息
     * @param fcOrderPartId
     * @return
     */
    List<OrderFactoryPartPost> listByPartId(Integer fcOrderPartId);

    /**
     * 通过工单厂商配件ID查找
     * @param fcOrderPartId
     * @return
     */
    List<OrderFactoryPartPost> findByFcOrderPartId(Integer fcOrderPartId);

    /**
     * 根据订单id删除
     * @param orderId
     * @return
     */
    void deleteByOrderId(Long orderId);

    /**
     * 根据厂商配件id
     * @param fcOrderPartId
     */
    void deleteByFcOrderPartId(Integer fcOrderPartId);

    /**
     * 根据厂商配件id批量删除
     * @param fcOrderPartIds
     */
    void deleteByFcOrderPartIds(List<Integer> fcOrderPartIds);

    /**
     * 根据厂商配件id删除邮寄记录
     * @param fcOrderPartId
     */
    void deleteSend(Integer fcOrderPartId);
    /**
     * 根据厂商配件id删除邮寄记录
     * @param fcOrderPartId
     */
    void deleteReturn(Integer fcOrderPartId);
    /**
     * 通过orderId查询
     * @param orderId
     * @return
     */
    List<OrderFactoryPartPost> listByOrderId(Long orderId);

    List<OrderFactoryPartPost> listByFcPartId(Integer fcOrderPartId);

    /**
     * 通过postId查询
     * @param partPostIds
     * @return
     */
    List<OrderFactoryPartPost> listByPostIds(List<String> partPostIds);

    /**
     * 修改邮寄配件信息
     * @param orderFactoryPartPostList
     * @throws OmsBaseException
     */
    void updateExpressById(List<OrderFactoryPartPost> orderFactoryPartPostList) throws OmsBaseException;

    /**
     * 查询列表
     * @param factoryPartQuery
     * @return
     */
    List<OrderFactoryPartPost> listByQuery(OrderFactoryPartPostQuery factoryPartQuery);

    /**
     * 查询是否存在邮寄旧件
     */
    public int findOldPartPostCount(Long orderId);

    void updatePostStatus(OrderFactoryPartPost orderFactoryPartPost);

    /**
     * 根据快递单号
     * @return
     */
    List<OrderFactoryPartPost> listByExpressCode(String code);

    /**
     * 查询特定条件下的邮寄信息
     * @return
     */
    List<OrderFactoryPartPost> listForOrderPart(OrderFactoryPartPostQuery factoryPartQuery);

    /**
     * 根据快递单号和快递公司编码查询订单id
     */
    OrderFactoryPartPost findOrderIdByExpressCodeAndExpressCompanyCode(String expressCode, String expressCompanyCode);
}
